
<table id="table_note" width="100%"  cellspacing="1" class="sf_admin_list" align="center">
	<tr>
	    <th width="1%"> # </th>
	    <th width="15%" scope="col">Alert date</th>
		<th width="20%" scope="col">Content</th>
		<th width="5%" scope="col">Type</th>
		<th width="8%" scope="col">Status</th>
		<th width="5%" scope="col">Active</th>	
		<th width="5%" scope="col">Action</th>				
	</tr>
	<?php $counter = 0; ?>
	<?php foreach($alerts as $alert): ?>
		<?php $counter ++; ?>
		<?php $class = '' ; //$alert->getAlertDegree(); ?>
		<tr>
			<td > <span style="font-weight: bold"><?php echo $counter; ?></span></td>
			<td><?php echo object_input_date_tag($alert, 'getAlertDate', array('format' => 'd', 'calendar_button_img' => '/sf/sf_admin/images/date.png',	'rich' => 'true', 'name' => 'AlertDate'.$counter, 'id' => 'alert'.$counter.'_alert_date','class' => $class)) ?></td>	
			<td>
				<?php echo textarea_tag('Content'.$counter, $alert->getContent(), array('class' => $class,
					 'id' => 'alert'.$counter.'_content', 'size' => '50x1')) ?>
			</td>
			<td>
				<?php echo select_tag('Alert_Type'.$counter, options_for_select(CommonValues::getAlertType(), $alert->getAlertType()), 
				array('id' => 'alert'.$counter.'_alert_type', 'class' => $class)); ?> 
			</td>
			<td>
			<?php echo select_tag('Status'.$counter, options_for_select(array('1' => 'Not complete', '2' => 'Completed'), $alert->getStatus()), 
				array('id' => 'alert'.$counter.'_status', 'class' => $class)); ?> 
			</td>
			<td>
		
			<?php echo object_checkbox_tag($alert, 'getEnable', 
				array('style' => 'text-align: center', 'name' => 'Enable'.$counter, 'style' => 'color: black'))?></td>
			<td>
			<?php if(!$alert->isNew()): ?>
				<ul class="sf_admin_td_actions">
				  <li>
				  <?php switch($sf_context->getModuleName()){
				  	case 'potentiality': 
				  		$type = CommonValues::PROSPECT ;
				  		break;
				  	case 'follow_up':
				  		$type = CommonValues::FOLLOW_UP ;
				  		break;
				  	case 'student':
				  		$type = CommonValues::STUDENT ; 
				  		break;	
				  }			  	
				  	?>

				  <?php echo link_to(image_tag('/sf/sf_admin/images/delete_icon.png', array('alt' => __('delete'), 'title' => __('delete'))), 'alert/deleteAlert?type='.$type.'&id='.$sf_params->get('id').'&alert='.$alert->getId(), array (
					  'post' => true,
					  'confirm' => __('Are you sure?'),
					)) ?>
				  </li>
				</ul>
				<?php endif; ?>
			</td>
		</tr>					  	
		<?php endforeach; ?>
		<input type="hidden" name="counter" value="<?php echo $counter; ?>">
</table>

